package ld.service.impl;

import ld.mapper.DeptMapper;
import ld.pojo.Dept;
import ld.service.DeptService;
import ld.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @Author: Liudao
 * @Date: 2022-08-01-22:16
 * @Description:
 */
public class DeptServiceImpl implements DeptService {
    @Override
    public List<Dept> findAll() {
        try(SqlSession session = MybatisUtil.getSqlSession()) {
            DeptMapper deptMapper = session.getMapper(DeptMapper.class);
            return deptMapper.selectByExample(null);
        }
    }
}
